<!DOCTYPE html>

<html class="no-js">

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title></title>
  <meta name="description" content="" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <script src="https://cdn.staticfile.org/axios/0.19.0-beta.1/axios.js"></script>
  <script src="../../cdn/vue/vue.global.min.js"></script>
  <link rel="stylesheet" href="../../cdn/element-plus/index.css" />
  <script src="../../cdn/element-plus/index.full.min.js"></script>

  <link rel="stylesheet" href="../../../lib/index.css" />
  <script src="../../../lib/avue.js"></script>
</head>

<body>
  <div id="app">
    {{form}}
    <avue-form :option="option" ref="form" v-model="form"></avue-form>
  </div>
</body>
<script>
  var app = Vue.createApp({
    data() {
      return {
        form: {
          text1: 0,
        },
        option: {
          column: [{
            label: '内容1',
            prop: 'text1',
            type: 'radio',
            control: (val, form) => {
              if (val === 0) {
                return {
                  text2: {
                    display: true
                  },
                  text3: {
                    label: '内容3'
                  }
                }
              } else {
                return {
                  text2: {
                    display: false
                  },
                  text3: {
                    label: '有没有发现我变了'
                  }
                }
              }
            },
            dicData: [{
              label: '显示',
              value: 0
            }, {
              label: '隐藏',
              value: 1,
            }]
          }, {
            label: '内容2',
            prop: 'text2',
            display: true
          }, {
            label: '内容3',
            prop: 'text3'
          }]
        }
      }
    }
  })
  app.use(ElementPlus)
  app.use(AVUE)
  app.mount('#app')
</script>

</html>